#include <stdio.h>

void fun(char** p)
{
    for (int i = 0; i < 4; i++) printf("%s", p[i]);
}
void test1()
{
    char* s[6] = { "ABCD", "EFGH", "IJKL", "MNOP", "QRST", "UVWX" };
    fun(s);
    printf("\n");
}


void test2()
{
    int a[3][4] = { 0 };
    a[1][1] = 10;
    int a1 = *(&a[0][0] + 5); //从a[0][0]地址开始加5个int到a[1][1]
    int a2 = *(*(a + 1) + 1); //*(a + 1)就是 &a[1][0]
    int a3 = *(&a[1] + 1); //要注意&a[1]和&a[1][0]的区别，a[1]就是&a[1][0]
    int a4 = *(a[1] + 1); //a[1]就是&a[1][0]

    printf("%d %d %d\n",a[1], &a[1][0], *(a + 1));
    printf("%d %d %d %d\n", a1, a2, a3, a4);
}


void test4()
{
    int* k[10][30];
    printf("%d\n", sizeof(k));//300 * 4;
}


void f(int** p); //相当于二维数组
void test5()
{
    int a[4] = { 1,2,3,4 };
    int b[3][4] = { {1,2,3,4},{5,6,7,8},{9,10,11,12} };
    int* q[3] = { b[0],b[1],b[2] };
    //f(a);
    //f(b);
    //f(q);
    //f(&a);
}

int main()
{
    test1();
    test2();

    test4();
    test5();

    return 0;
}